﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第109题
//BC111 小乐乐与进制转换
//https://www.nowcoder.com/practice/242eafef2a704c0ca130d563b7b3ee2d?tpId=107&tqId=33392&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D3%26tpId%3D107%26type%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include<stdio.h>
//递归转换进制
void print(int x)
{
    if (x > 5)
    {
        print(x / 6);
    }
    printf("%d", x % 6);
}
int main()
{
    int n = 0;
    scanf("%d", &n);
    print(n);
    return 0;
}